package com.collaboration.proton.services;

import com.collaboration.proton.dao.PlayerRepository;
import com.collaboration.proton.entities.Player;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author thousandcat
 * @param
 * @return 无
 *
 */
@Service
public class PlayerService {
    @Autowired
    PlayerRepository playerRepository;

    public List<Player> getAll(){
        return playerRepository.findAll();
    }

    public Player save(Player player){
        return playerRepository.save(player);
    }

    public Player findPlayerByUserName(String userName){
        return playerRepository.findPlayerByUserName(userName);
    }
}
